package gao.xiaolei.controller;

import gao.xiaolei.service.PageService;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.GetMapping;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

@org.springframework.stereotype.Controller
public class Controller {

	@Resource(name="PageService")
	private PageService pageService;
	
	@GetMapping("/training")
	public String getTraining(@CookieValue("access_token") String access_token,
			HttpServletResponse response) {
		response.setHeader("Cache-Control", "no-store");
		return pageService.getReturnPage(access_token);
	}

	@GetMapping("/login")
	public String getLogin() {
		return "login";
	}

	@GetMapping("/register")
	public String getRegister() {
		return "register";
	}

	@GetMapping("/editor")
	public String getEditor() {
		return "view/training/editor/index";
	}

}
